package com.rc.saas.tenant.service.elec;


import com.github.pagehelper.PageInfo;
import com.rc.saas.tenant.base.BaseService;
import com.rc.saas.tenant.common.vo.TResponse;
import com.rc.saas.tenant.mapper.elec.ElecGunMapper;
import com.rc.saas.tenant.model.elec.ElecGun;
import com.rc.saas.tenant.model.elec.ElecGunExample;
import com.rc.saas.tenant.model.elec.ElecStation;
import com.rc.saas.tenant.search.StatisticsSearch;
import com.rc.saas.tenant.search.elec.ElecGunSearch;
import com.rc.saas.tenant.vo.elec.ElecPileStatusCountVo;
import com.rc.saas.tenant.vo.gun.ElecGunMonitorChartVo;
import com.rc.saas.tenant.vo.gun.ElecGunMonitorVo;

import java.util.List;

/**
 * Created by yang on 2022-04-17
 */
public interface ElecGunService extends BaseService<Long, ElecGun, ElecGunExample, ElecGunMapper> {

    void updateGunStatus(Long elecGunId);

    long countUseGun(String tenantCode);

    long countGun(String tenantCode);

    /**
     * 正向互联时，根据第三方运营商ID和第三方枪号查找（唯一）
     */
    ElecGun selectByOperatorIdAndGunNo(String tenantCode, String hlhtOperatorId, String hlhtGunNo);

    /**
     * 通过桩编号查出对应的枪id
     */
    List<ElecGun> listGunByPileId(Long pileId);

    PageInfo<ElecGun> listPageByCondition(ElecGunSearch elecGunSearch);

    /**
     * 批量更新枪运营状态
     */
    void updateBatchElecGunOperateStatusByElecStationIdList(List<Long> elecStationIdList, String operateStatus);

    List<ElecGun> listElecGunByElecStationIdList(List<Long> elecStationIdList);

    /**
     * 根据elecPileId获取elecGun
     * @param elecPileIdList
     * @return
     */
    List<ElecGun> listElecGunByElecPileIdList(List<Long> elecPileIdList);

    ElecGun selectGunByGunNo(String gunNo);

    TResponse saveOrUpdateElecGun(ElecGun elecGun, String tenantCode, String loginName);

    /**
     * 充电枪设备监控
     * @param elecGunSearch
     * @return
     */
    PageInfo<ElecGunMonitorVo> listPageByMonitor(ElecGunSearch elecGunSearch);

    TResponse listPageLintChart(String stationNo,String type);


    ElecPileStatusCountVo countGun(StatisticsSearch search);

    void updateGunOperators(Long pileId,Long operatorId,Long elecStationId);

    void updateOperatorBySId(ElecStation elecStation);
}
